//引入“mongoose"依赖
const mongoose =require('mongoose');

//链接数据库：h51866
mongoose.connect('mongodb://localhost/h51866');

// Schema-数据结构：用户
const userSchema = new mongoose.Schema({
	username: String,
	password: String,
	regTime: Date
});

// Schema-数据结构：账单
const billsSchema = new mongoose.Schema({
	name: String,
	company: String,
	money: Number,
	count: Number
});

//Model-集合：用户
const User=mongoose.model('user',userSchema);

//Model-集合：账单
const Bill=mongoose.model('bill',billsSchema);

module.exports={User,Bill};